import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import {renderIconfontIcon} from '@/utils';
const routeName = 'resource';

const routes: Array<RouteRecordRaw> = [
    {
        path: '/resource',
        name: routeName,
        redirect: '/resource/book-resource-list',
        component: Layout,
        meta: {
            title: '资源管理',
            icon: renderIconfontIcon("icon-caidan_ziyuanguanli"),
            sort: 1,
            hidden:true
        },
        children: [
            {
                path: 'book-resource-list',
                name: `book-resource-list`,
                meta: {
                    title: '图书'
                },
                component: () => import('@/views/resource/book/book-resource-list.vue')
            },
            {
                path: 'book-resource-edit',
                name: `book-resource-edit`,
                meta: {
                    title: '图书资源编辑',
                    keepAlive: true,
                    hidden: true
                },
                component: () => import('@/views/resource/book/book-resource-edit.vue')
            },
            {
                path: 'resource-list',
                name: `${routeName}_list`,
                meta: {
                    title: '资源列表',
                    keepAlive: true,
                    hidden:true
                },
                component: () => import('@/views/resource/resource-list.vue')
            },
            {
                path:'resource-detail/:pageType/:type',
                name: `${routeName}_detail`,
                component: () => import('@/views/resource/resource-detail.vue'),
                meta: {
                    title: `修改资源`,
                    hidden:true
                },
            }
        ],
    },
];

export default routes;
